<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<link rel="stylesheet" href="/wk2un10/houtai/lib/layui/css/layui.css">
<body>
	<form class="layui-form" action="userservl"><!--表单	-->		
			<div class="layui-form-item">
			<label class="layui-form-label"><span style="color: red;">*</span>查询编号</label><!--标题-->
				<div class="layui-input-inline" ><!--<div class="layui-input-lnline">不占一行 block独占一行-->
					<input type="text" id="id" name="id" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label"><span style="color: red;">*</span>修改系列名称</label><!--标题-->
				<div class="layui-input-inline" ><!--<div class="layui-input-lnline">不占一行 block独占一行-->
					<input type="text" id="productTypeName" name="productTypeName" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
				</div>
			
			<div class="layui-form-item">
				<div class="layui-input-block">
				 <!--lay-filter="formDemo"监听器-->
					<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				</div>
			</div>
	</form>
	<script type="text/javascript" src="/wk2un10/houtai/lib/layui/layui.js"></script>
	<script>
	layui.use('form', function() {
		var form = layui.form;
		var $ = layui.jquery; //引入jquery
		//监听提交
		form.on('submit(formDemo)', function(data) {
			var d = data.field; //表单中的数据，定义一个对象来接收
			//通过ajax向数据库提交数据了
			d.method="update";
			
			var url ='/wk2un10/ProdoucttypeSqlServlet';
			//确保数据没有问题就进行ajax提交了
			$.post(url, d,
				function(data) {
					if(data.count>0){//对应Result里面的count
						console.log('修改成功');
						var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
     					 parent.layer.close(index);		//关闭窗口
					}
				}, "json");
			return false;
		});
	});
	</script>
</body>
</html>